/*!
*  spcpl-0.1.0.min.js
*  SharePoint Cross Plaform Library
*  https://spcpl.codeplex.com/
*
*  An open source JavaScript library that enables easy cross platform programming
*  against all currently supported versions of SharePoint
* (2007, 2010, 2013, Office 365/SharePoint Online, and beyond!)
*
*  Migrate with ease!
*/
(function (window, undefined) {
    "use strict";

    var THIS_LIBRARY_VERSION_STRING = "0.1.0";

    //#region determine if shouldImplementLibrary
    // immediately do detection to see if the library has already been loaded
    var shouldImplementLibrary = true;

    if (window.spcpl && window.spcpl.version) {
        // it appears that the SharePoint Cross Platform JavaScript library has already been loaded on this page
        // see if the version number is higher or lower than this current version number.
        function convertVersionStringToNumber(versionStringToConvert) {
            var returnValue = 0;
            if (versionStringToConvert !== undefined && typeof versionStringToConvert === "string" && versionStringToConvert.length > 0 && versionStringToConvert.indexOf(".") > -1) {
                var peices = versionStringToConvert.split(".");
                if (peices.length === 3) {
                    for (var i = 0; i < peices.length; i++) {
                        returnValue = returnValue + (parseInt(peices[i]) * Math.pow(1000, i));
                    }
                }
            }

            return returnValue;
        }

        var detectedVersionNumberForCompare = convertVersionStringToNumber(window.spcpl.version);
        var thisLibraryVersionNumberForCompare = convertVersionStringToNumber(THIS_LIBRARY_VERSION_STRING);
        shouldImplementLibrary = detectedVersionNumberForCompare < thisLibraryVersionNumberForCompare;
    }

    if (shouldImplementLibrary) {
        // we will now implement the library!
        //#region cache DOM objects as local variables
        var location = window.location;
        var document = window.document;
        var documentElement = window.documentElement;

        //#endregion
        //#region setup namespaces
        // setup namespaces
        var spcplNamespace = window.spcpl ? window.spcpl : {};

        //#endregion
        //#region PUBLIC STATIC FIELD: spcpl.version
        spcplNamespace.version = THIS_LIBRARY_VERSION_STRING;

        //#endregion
        //#region write namespaces back to global variables
        window.spcpl = spcplNamespace;
        //#endregion
    }
})(window);
//# sourceMappingURL=spcpl-0.1.0.js.map
